<template>
  <div>
    <div class="home">{{ city }} {{ text }} {{ temp }}℃</div>
    <br />
    <p>Jenkins测试</p>
    <p>Jenkins测试</p>
    <p>Jenkins测试</p>
    <p>Jenkins测试</p>
  </div>
</template>

<script>
  export default {
    name: 'Home',
    data() {
      return {
        city: '广州',
        text: null,
        temp: null,
      };
    },
    mounted() {
      const demoData = {
        openid: null,
        airportCode: 'CAN',
        type: 2,
        page: 1,
        rows: 10,
      };
      this.$http.demo.list(demoData).then(res => {
        console.log(res);
      });

      this.$http.demo
        .weatherInfo({
          locationName: this.city,
          type: 'now',
        })
        .then(res => {
          console.log(res);
          if (res && res.data) {
            const {
              data: { now },
            } = res;
            this.text = now.text;
            this.temp = now.temp;
          }
        });
    },
  };
</script>
